package com.starhub.api.document.token;

import java.time.LocalDateTime;

import com.starhub.common.sys.user.LoginUser;

/**   
 * 下载token
 * @version: V1.0
 * @author: liuhf
 * @time 2025-05-22
 */
public class DownloadToken {
    private final Long fileId;
    private final LoginUser user;
    private final LocalDateTime expiryTime;
    
    public DownloadToken(Long fileId, LoginUser user, LocalDateTime expiryTime) {
        this.fileId = fileId;
        this.user = user;
        this.expiryTime = expiryTime;
    }

    public Long getFileId() {
        return fileId;
    }

    public LoginUser getUser() {
        return user;
    }

    public boolean isExpired() {
        return LocalDateTime.now().isAfter(expiryTime);
    }
} 